statefiles: unify host6 writing
authorDavid Härdeman <[email protected]>
Sat, 8 Nov 2025 14:46:14 +0000 (15:46 +0100)
committerÁlvaro Fernández Rojas <[email protected]>
Tue, 11 Nov 2025 07:30:44 +0000 (08:30 +0100)
commitbf9889dfcd47aff017022940a0407ed5414eb698
tree7c1b7baeb2c1d97d24afc31d4fd22a27175d2649
parent593b6b72927c57b91dea543781bd5664f3edaa55
statefiles: unify host6 writing

The statefile is a mix of state comments and hostsfile entries, reuse the
hosts writing logic when writing the statefile to reduce duplication.
(note that this has a tiny extra cost in that inet_ntop() is called
twice, that'll go away later when we drop the hostsfile style lines from
the statefile).

Signed-off-by: David Härdeman <[email protected]>
Link: https://github.com/openwrt/odhcpd/pull/302
Signed-off-by: Álvaro Fernández Rojas <[email protected]>
src/statefiles.c